<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>登陆页面</title>
	<script src="lib/jquery-3.4.1.js"></script>
	<script src="lib/jquery-3.4.1.min.js"></script>
</head>
<body style="width: 1500px;height:800px;background-image: url(背景图3.jpg);background-size: 100% 100%;display: flex;flex-direction:column;justify-content:center;align-items:center;">
	<div style="display:flex;flex-direction:row;justify-content:center;align-items:center;margin-bottom:10px;">
		<img src="星球.png">
		<span style="margin-left:10px;font-size: 60px;font-family:bold;color:#071f3e;">Space Explorer</span>
	</div>
	<div>
		<form method="post" name="form1">
			<table>
				<tr>
					<td style="font-size:20px;color:#071f3e;">用户名</td>
					<td><input style="width:300px;height:40px;border:1px solid #000;font-size: 15px;" name="username"></td>
				</tr>
				<tr>
					<td style="font-size:20px;color:#071f3e;">密&nbsp;&nbsp;&nbsp;码</td>
					<td><input type="password" style="width:300px;height:40px;border:1px solid #000;font-size: 15px;" name="password"></td>	
				</tr>
			</table>
			<div style="display:flex;flex-direction:row;justify-content:center;align-items:center;">
				<button onclick="submit2()" style="width:100px;height: 30px;margin:10px;color:#071f3e;">登录</button>
				<button style="width:100px;height: 30px;margin: 10px;color:#071f3e;">重置</button>
			</div>
		</form>
	</div>
	<div style="display: flex;flex-direction: column;justify-content:center;align-items:center;margin-top:70px;color:#071f3e;">
		<span>-----------</span>
		<span>初始账号密码</span>
		<span>账号：nfu</span>
		<span>密码：12345678</span>
		<span>-----------</span>
	<div>
</body>
</html>

<script>
	var usernamedata=[['nfu','12345678']]
	function submit2(){
		var username = document.form1.username.value;
		var psword = document.form1.password.value;
		if(username.length==0){
			alert("请输入账号")
			return
		}
		if(psword.length==0){
			alert("请输入密码")
			return
		}


		for(var i=0;i<usernamedata.length;i++){
			if(usernamedata[i][0]==username && usernamedata[i][1]==psword){
				alert("登录成功");
				window.open("project.html")
				break;
			}
		}
		alert("账号和密码错误")
	}

</script>